// 构造第三方网址实现登录
export function loginAgain() {
  const client_id = 'suiteihfzbkbsm0thrqgi'
  const redirectUri = encodeURIComponent(window.location.origin) // 该参数旨在：获取到autCode之后重定向的地址页面
  const scope = encodeURIComponent('openid corpid')
  const state = 'bituo' // 状态值,用于防止CSRF攻击
  const loginUrl = `https://login.dingtalk.com/oauth2/auth?redirect_uri=${redirectUri}
                    &response_type=code&client_id=${client_id}
                    &scope=${scope}&prompt=consent&state=${state}`
  location.href = loginUrl  // 跳转到钉钉第三方网站进行登录验证
}
